<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%--
 /**
  功能名称:用户批量导出
  创建时间:2010-7-15
  创建人:
*/
--%>
<%

response.setHeader("Content-disposition","attachment; filename=report.xls"); 
	String exportField = (String) request.getAttribute("exportField");
	String path = request.getContextPath();
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" 
"http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	</head>

	<body>
		<table align="center" border="1" bordercolor="black" cellpadding="0"
			cellspacing="0">
			<tr>
				<%if (exportField.indexOf("UserId") != -1) {%><%-- @author: @date:2011-7-6 15:55:22  --%>
				<td>
					${user.userType eq 1?"学籍号":"人事编号"}
				</td>
				<%}%>
				<%
					if (exportField.indexOf("account") != -1) {
				%>
				<td>
					帐号
				</td>
				<%
					}
				%>

				<%
					if (exportField.indexOf("name") != -1) {
				%>
				<td>
					姓名
				</td>
				<%
					}
				%>

				<%
					if (exportField.indexOf("sex") != -1) {
				%>
				<td>
					性别
				</td>
				<%
					}
				%>
				<%
					if (exportField.indexOf("password") != -1) {
				%>
				<td>
					密码
				</td>
				<%
					}
				%>

				<%
					if (exportField.indexOf("oldName") != -1) {
				%>
				<td>
					曾用名
				</td>
				<%
					}
				%>


				<%
					if (exportField.indexOf("idNumber") != -1) {
				%>
				<td>
					身份证号
				</td>
				<%
					}
				%>

				<%
					if (exportField.indexOf("birthday") != -1) {
				%>
				<td>
					出生年月
				</td>
				<%
					}
				%>

				<%
					if (exportField.indexOf("mobileNumber1") != -1) {
				%>
				<td>
					手机号码
				</td>
				<%
					}
				%>

				<%
					if (exportField.indexOf("politicalLandscape") != -1) {
				%>
				<td>
					政治面貌
				</td>
				<%
					}
				%>

				<%
					if (exportField.indexOf("nation") != -1) {
				%>
				<td>
					民族
				</td>
				<%
					}
				%>

				<%
					if (exportField.indexOf("national") != -1) {
				%>
				<td>
					国籍
				</td>
				<%
					}
				%>

				<%
					if (exportField.indexOf("birthplace") != -1) {
				%>
				<td>
					籍贯
				</td>
				<%
					}
				%>

				<%
					if (exportField.indexOf("accountType") != -1) {
				%>
				<td>
					户口类型
				</td>
				<%
					}
				%>

				<%
					if (exportField.indexOf("accountAddress") != -1) {
				%>
				<td>
					户口所在地
				</td>
				<%
					}
				%>

				<%
					if (exportField.indexOf("address") != -1) {
				%>
				<td>
					家庭地址
				</td>
				<%
					}
				%>

				<%
					if (exportField.indexOf("email") != -1) {
				%>
				<td>
					电子邮件
				</td>
				<%
					}
				%>

			</tr>
			<c:forEach items="${requestScope.UserLIST}" var="p">
				<tr>
					<%if (exportField.indexOf("UserId") != -1) {%><%-- @author: @date:2011-7-6 15:55:22  --%>
					<td style="vnd.ms-excel.numberformat:@">
						${p.userId}
					</td>
					<%}%>
					<%
						if (exportField.indexOf("account") != -1) {
					%>
					<td style="vnd.ms-excel.numberformat:@">
						${p.account}
					</td>
					<%
						}
					%>
					<%
						if (exportField.indexOf("name") != -1) {
					%>
					<td style="vnd.ms-excel.numberformat:@">
						${p.name}
					</td>
					<%
						}
					%>
					<%
						if (exportField.indexOf("sex") != -1) {
					%>
					<td>
						${requestScope.sexMap[p.sex]  }
					</td>
					<%
						}
					%>
					
					<%
						if (exportField.indexOf("password") != -1) {
					%>
					<td>
						${p.password }
					</td>
					<%
						}
					%>

					<%
						if (exportField.indexOf("oldName") != -1) {
					%>
					<td style="vnd.ms-excel.numberformat:@">
						${p.oldName }
					</td>
					<%
						}
					%>


					<%
						if (exportField.indexOf("idNumber") != -1) {
					%>
					<td style="vnd.ms-excel.numberformat:@">
						${p.idNumber }
					</td>
					<%
						}
					%>

					<%
						if (exportField.indexOf("birthday") != -1) {
					%>
					<td>
						<fmt:formatDate type="date" value='${p.birthday }' />
					</td>
					<%
						}
					%>

					<%
						if (exportField.indexOf("mobileNumber1") != -1) {
					%>
					<td style="vnd.ms-excel.numberformat:@">
						${p.mobileNumber1 }
					</td>
					<%
						}
					%>

					<%
						if (exportField.indexOf("politicalLandscape") != -1) {
					%>
					<td>
						${requestScope.polityVisageMap[p.politicalLandscape]  }
					</td>
					<%
						}
					%>

					<%
						if (exportField.indexOf("nation") != -1) {
					%>
					<td>
						${requestScope.folkMap[p.nation] }
					</td>
					<%
						}
					%>

					<%
						if (exportField.indexOf("national") != -1) {
					%>
					<td>
						${requestScope.nationalMap[p.national] }
					</td>
					<%
						}
					%>

					<%
						if (exportField.indexOf("birthplace") != -1) {
					%>
					<td>
						${p.birthplace}
					</td>
					<%
						}
					%>

					<%
						if (exportField.indexOf("accountType") != -1) {
					%>
					<td>
						 <c:set var="accountString" value="${p.accountType}" scope="page"/>
						 <%
						 
						 if(pageContext.getAttribute("accountString")!=null){
							 String a = pageContext.getAttribute("accountString").toString();
							 pageContext.setAttribute("accountTypeString",a);
						 }
						  %> 
						${requestScope.registeredPermanentResidenceMap[pageScope.accountTypeString] }
					</td>
					<%
						}
					%>

					<%
						if (exportField.indexOf("accountAddress") != -1) {
					%>
					<td >
						${p.accountAddress}
					</td>
					<%
						}
					%>

					<%
						if (exportField.indexOf("address") != -1) {
					%>
					<td style="vnd.ms-excel.numberformat:@">
						${p.address }
					</td>
					<%
						}
					%>

					<%
						if (exportField.indexOf("email") != -1) {
					%>
					<td style="vnd.ms-excel.numberformat:@">
						${p.email }
					</td>
					<%
						}
					%>



				</tr>
			</c:forEach>
		</table>
	</body>
</html>
